//
//  YJResultModel.m
//  练习04
//
//  Created by hcios on 2017/7/6.
//  Copyright © 2017年 hcios. All rights reserved.
//

#import "YJResultModel.h"
#import "Tools.h"

@implementation YJResultModel

-(instancetype)initWithDict:(NSDictionary *)dict{
    
    if (self = [super init]) {
        _trip_days_self_id = numberToString(dict[@"id"]);
        _trip_days_trip_date = NonEmptyString(dict[@"trip_date"]);
        _trip_days_day = numberToString(dict[@"day"]);
        
    }
    return self;
}

-(instancetype)initWithDict2:(NSDictionary *)dict{
    
    if (self = [super init]) {
        _nodes_id = numberToString(dict[@"id"]);
        _nodes_comment = NonEmptyString(dict[@"comment"]);
        _nodes_entry_name = NonEmptyString(dict[@"entry_name"]);
        
    }
    return self;
}

-(instancetype)initWithDict3:(NSDictionary *)dict{
    
    if (self = [super init]) {
        _nodes_comment = NonEmptyString(dict[@"comment"]);
        _nodes_entry_name = NonEmptyString(dict[@"entry_name"]);
        _notes_id = numberToString(dict[@"id"]);
        _notes_description = NonEmptyString(dict[@"description"]);
        _photo_id = numberToString(dict[@"photo"][@"id"]);
        _photo_image_width = numberToString(dict[@"photo"][@"image_width"]);
        _photo_image_height = numberToString(dict[@"photo"][@"image_height"]);
        _photo_url = NonEmptyString(dict[@"photo"][@"url"]);

        
    }
    return self;
}

-(instancetype)initWithHeaderDict:(NSDictionary *)dict{
    if (self = [super init]) {
        _header_front_cover_photo_url = NonEmptyString(dict[@"front_cover_photo_url"]);
        _header_start_date = NonEmptyString(dict[@"start_date"]);
        _header_name = NonEmptyString(dict[@"name"]);
        _user_image = NonEmptyString(dict[@"user"][@"image"]);
    }
    return self;
}

@end
